#include "xparameters.h"
#include "xiicps.h"
#include "xscutimer.h"
#include "xil_printf.h"


#define SCU_TIMER_AUTO_LOAD_INIT_VAL (0xFFFFFFFF)

#define	DEVICE_ID_1848		0x3740038
#define IIC_DEVICE_ID		XPAR_XIICPS_0_DEVICE_ID
#define IIC_1848_ADDR		0x3
#define IIC_SCLK_RATE		100000
#define TEST_BUFFER_SIZE	132
#define HOST_REGS_DEVID 0xFFFFFFFF

typedef struct _IIC_DATA_
{
	unsigned int adrs;
	unsigned int data;
}IIC_DATA;

//int IicPsMasterPolledExample(u16 DeviceId);
int IIC1848Init( unsigned int iicDeviceAdrs, unsigned int iicSclkRate );
unsigned int IICReadReg( unsigned int devID, unsigned int offset, unsigned int *readdata );
unsigned int IICWriteReg( unsigned int devID, unsigned int offset, unsigned int  writedata );
void IICWaitSec( unsigned int delay_nsec, unsigned int delay_sec );

XIicPs Iic;
XScuTimer Timer;
